home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / onlypc / java / samples.bin / calculate.java < prev    next >
Text File  |  1996-09-04  |  1KB  |  57 lines

  1. import java.awt.*;
  2.  
  3. public class calculate extends java.applet.Applet {
  4.  
  5.     public void init() {
  6.  
  7.         //{{INIT_CONTROLS
  8.         setLayout(null);
  9.         addNotify();
  10.         resize(284,153);
  11.         label1 = new java.awt.Label("Welcome to the Calculation Applet!",Label.CENTER);
  12.         label1.reshape(18,18,234,18);
  13.         add(label1);
  14.         SimpleCalcButton = new java.awt.Button("Simple Calculations");
  15.         SimpleCalcButton.reshape(66,54,144,24);
  16.         add(SimpleCalcButton);
  17.         LoanCalcButton = new java.awt.Button("Loan Calculations");
  18.         LoanCalcButton.reshape(66,90,144,24);
  19.         add(LoanCalcButton);
  20.         //}}
  21.     }
  22.  
  23.     //{{DECLARE_CONTROLS
  24.     java.awt.Label label1;
  25.     java.awt.Button SimpleCalcButton;
  26.     java.awt.Button LoanCalcButton;
  27.     //}}
  28.  
  29.     public void ShowCalculateFrame() {
  30.         CalculateFrame myNewFrame;
  31.         myNewFrame = new CalculateFrame();
  32.         myNewFrame.show();
  33.  
  34.     }
  35.  
  36.     public boolean handleEvent(Event event) {
  37.         if (event.id == Event.ACTION_EVENT && event.target == LoanCalcButton) {
  38.                 ShowLoanCalc();
  39.                 return true;
  40.         }
  41.         else
  42.  
  43.         if (event.id == Event.ACTION_EVENT && event.target == SimpleCalcButton) {
  44.             ShowCalculateFrame();
  45.             return true;
  46.         }
  47.  
  48.         return super.handleEvent(event);
  49.     }
  50.  
  51.     public void ShowLoanCalc() {
  52.         LoanCalc myLoanCalc;
  53.         myLoanCalc = new LoanCalc();
  54.         myLoanCalc.show();
  55.     }
  56. }
  57.